export default {
  toStr: function (obj) {
    var res = '';
    if (typeof obj == 'string') {
      res = obj;
    } else if (typeof obj == 'object') {
      res = JSON.stringify(obj);
    }
    return res;
  },
  toJson: function (str) {
    var res = '';
    if (str != '' && str != undefined && str != null) {
      if (typeof str == 'string') {
        str = str.trim();
        res = JSON.parse(str) ? JSON.parse(str) : eval('(' + str + ')');
      } else if (typeof str == 'object') {
        res = str;
      }
    }
    return res;
  },
  toInt(str) {
    return parseInt(str);
  },
  toDouble(str) {
    return parseFloat(str).toFixed(2);
  },
  toBoolean() {
  },
  toDate() {
  },
  fromInt() {
  },
  fromDouble() {
  },
  fromBoolean() {
  },
  fromDate() {
  },
  fromJson() {
  },
  grep() {
  },
}